package com.example.day1104;

/**
 * @author Lenovo
 */
public class Person {
    private String name;
    private int age;
    public Person(){
    }
    public Person(String name,int age){
        this.name = name;
        this.age = age;
    }
    public String getName(){
        return name;
    }
    public void setName(String name){
        this.name = name;
    }
    public int getAge(){
        return age;
    }
    public void setAge(int age){
        this.age = age;
    }

    public void eat() {

    }
    public abstract class Player extends Person{
        public Player(){
        }
        public Player(String name,int age){
            super(name,age);
        }
        public abstract void study();
    }
    public abstract class Coach extends Person{
        public Coach(){
        }
        public Coach(String name,int age){
            super(name,age);
        }
        public abstract void teach();
    }
    public interface SpeakEnglish {
        public abstract void speak();
    }
    public class BasketballCoach extends Coach{
        public BasketballCoach(){
        }
        public BasketballCoach(String name,int age){
            super(name,age);
        }
        @Override
        public void teach() {
            System.out.println("BasketballCoach is teaching");
        }
        @Override
        public void eat() {
            System.out.println("BasketballCoach is eating");
        }
    }
    public class FootballCoach extends Coach implements SpeakEnglish{
        public FootballCoach(){
        }
        public FootballCoach(String name,int age){
            super(name,age);
        }
        @Override
        public void teach() {
            System.out.println("FootballCoach is teaching");
        }
        @Override
        public void eat() {
            System.out.println("FootballCoach is eating");
        }
        @Override
        public void speak() {
            System.out.println("FootballCoach is speaking");
        }
    }
    public class PingPangPlayer extends Player implements  SpeakEnglish
    {
        public PingPangPlayer(){
        }
        public PingPangPlayer(String name,int age){
            super(name,age);
        }
        @Override
        public void study() {
            System.out.println("PingPangPlayer is studying");
        }
        @Override
        public void eat() {
            System.out.println("PingPangPlayer is eating");
        }
        @Override
        public void speak() {
            System.out.println("PingPangPlayer is speaking");
        }
    }
    public class BasketballPlayer extends Player{
        public BasketballPlayer(){
        }
        public BasketballPlayer(String name,int age){
            super(name,age);
        }
        @Override
        public void study() {
            System.out.println("BasketballPlayer is studying");
        }
        @Override
        public void eat() {
            System.out.println("BasketballPlayer is eating");
        }
    }

}
